<div id="admin_user" class="admin_user_div">
	<div class="admin_user_title_div">
		<h1><?php echo ST_FORM_USER_ADMINISTRATION ?></h1>
	</div>
	<div class="admin_user_list_div">
		<form id="admin_user_form" action="index.php?section=admin&action=user" method="post">
			<table class="admin_user_list_table">
				<thead>
					<tr>
						<th></th>
						<th><?php echo ST_FORM_ID ?></th>
						<th><?php echo ST_FORM_USERNAME ?></th>
						<th><?php echo ST_FORM_EMAIL ?></th>
						<th><?php echo ST_FORM_RIGHTS ?></th>
					</tr>
				</thead>
				<tbody>
					<?php 
						foreach ($admin_sub_data['users'] as $user) {
							echo '<tr>';
								if ($user->get_id() !== getUserID())
									echo '<td><input type="checkbox" class="admin_user_list_checkbox" value="'.$user->get_id().'" name="userselection[]"></td>';
								else 
									echo '<td></td>';
								echo '<td>'.$user->get_id().'</td>';
								echo '<td>'.$user->get_username().'</td>';
								echo '<td>'.$user->get_email().'</td>';
								echo '<td id="rights_'.$user->get_id().'" '. ($user->get_id() !== getUserID() ? 'onclick="javascript:generate_rights_div('.$user->get_id().')"' : '') .'>';
								foreach (DAOFactory::getInstance('Userright')->getByUserId($user->get_id()) as $userright) {
									echo DAOFactory::getInstance('Right')->getById($userright->get_rightid())->get_name(). ' ';
								}
								echo '</td>';
							echo '</tr>';
						}
					?>
				</tbody>
			</table>
			<div class="admin_user_form_buttons">
				<a id="select_all_users" class="select_all_users_button"><?php echo ST_FORM_SELECT_ALL_ACTION ?></a> - 
				<a id="delete_selected_users" class="delete_selected_users_button"><?php echo ST_FORM_DELETE_SELECTED_ACTION ?></a>
			</div>
		</form>
	</div>
</div>